package com.whmall.service.crm.module.suppliercreditscore.enumeration;

import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Author：yangdong
 * Date：2020/12/11
 * Description：
 */
public enum CreditScoreChangeTypeEnum {

    GIVE_ME_CREDIT_SCORE(1001, "送我信用分"),

    SETTLEMENT_METHOD_TO_ACCOUNT_PERIOD(1002, "结算方式转为账期"),

    SYSTEM_DEFAULT_PRAISE(1003, "系统默认好评"),

    CUSTOMER_PRAISE(1004, "客户好评"),

    ORDER_CREDIT_IS_CLEARED_ANNUALLY(2001, "订单信用分年度清0"),

    SETTLEMENT_METHOD_TO_NON_ACCOUNT_PERIOD(2002, "结算方式转为非账期"),

    CUSTOMER_NEGATIVE_RATINGS(2003, "客户差评"),

    QUALITY_PROBLEM(2004, "质量问题"),

    PACKAGE_PROBLEM(2005, "包装问题"),

    LOGISTICS_PROBLEM(2006, "物流问题");

    public static CreditScoreChangeTypeEnum fromValue(Integer value) {
        for (CreditScoreChangeTypeEnum anEnum : values()) {
            if (anEnum.getValue().equals(value)) {
                return anEnum;
            }
        }
        throw new UnsupportedOperationException("不支持的类型" + value);
    }

    CreditScoreChangeTypeEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    private final Integer value;
    private final String name;

    @JsonValue
    public Integer getValue() {
        return value;
    }

    @JsonValue
    public String getName() {
        return name;
    }
}
